<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="/template/StakeholderTemplate.xhtml">

    <ui:define name="contentInsert">
        
        <h3>Outlet Access</h3>
                <h:form>
                    <p:dataTable value="#{outletAccessMB.getOutletsbyManager()}" var="o"
                                     emptyMessage="You are not in charge of any outlets!"
                                     >

                                    <p:column style="width: 10%">
                                        <f:facet name="header">Outlet ID</f:facet>
                                        #{o.id}
                                    </p:column>

                                    <p:column style="width: 40%">
                                        <f:facet name="header">Outlet Name</f:facet>
                                        #{o.outletName}
                                    </p:column>

                                    <p:column style="width: 40px">
                                        <f:facet name="header">Stakeholder</f:facet>
                                        #{o.stakeholder.name}
                                    </p:column>

                                    <p:column style="width: 10%">
                                        <p:commandButton action="./OutletManager/main.xhtml?faces-redirect=true" value="Manage This Outlet" actionListener="#{outletAccessMB.outletManagerLogin(o.id)}">  
                                        </p:commandButton>
                                    </p:column>
                        
                                </p:dataTable>
                </h:form>

    </ui:define>

</ui:composition>

